package com.kepler.social.app.cases;

import com.kepler.social.app.port.UserInfoEditPort;
import com.kepler.social.domain.user.account.UserAccountDomainService;
import com.kepler.social.generic.SecurityHelper;
import com.kepler.social.service.vo.LoginUser;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
@Slf4j
public class UserInfoEditCase implements UserInfoEditPort {

    @Resource
    private UserAccountDomainService userAccountDomainService;

    @Override
    public void userFeatureEdit(String feature, String featureValue) {
        LoginUser loginUser = SecurityHelper.getLoginUser();
        assert Objects.nonNull(loginUser);
        userAccountDomainService.userFeatureEdit(feature, featureValue, loginUser.getUser().getId());
    }
}
